package it.unibo.convoycruisecontrol.chiefboatsubsystem.test.mock;

import java.util.ArrayList;
import java.util.List;

import it.unibo.convoycruisecontrol.chiefboatsubsystem.IFlagDisplay;

public class MockFlagDisplay implements IFlagDisplay {

	private List<Boolean> boatStatuses;

	public MockFlagDisplay(int boatNumber)
	{
		if(boatNumber < 0)
			throw new IllegalArgumentException("The number of the boats cannot be negative");
		
		this.boatStatuses = new ArrayList<Boolean>();
		for (int i = 0; i < boatNumber; i++)
		{
			boatStatuses.add(false);
		}
	}

	public void setFlag(int seqPosition){
		boatStatuses.set(seqPosition, true);
	}

	public void clearFlag(int seqPosition){
		boatStatuses.set(seqPosition, false);
	}

	public List<Boolean> getDisplayedFlags(){
		return boatStatuses;
	}
}
